# 用于将2018/12/11日Magento系统清理暂挂订单时形成的发货记录处理完并形成销售出库单
# 并手工将此单改为从试运行仓出库后发货
#
require 'mysql2'

msid=184483
while msid<=184522 do
    #rds should be function variables since need new connection
    rds = Mysql2::Client.new(:host => ENV['RDS_AGENT'], :username => "psi_root", :port => '1401', :password => ENV['PSI_PASSWORD'])
    #sql = "call psi.shipGoodsII(#{msid},#{Time.now.strftime('%Y%m%d')})"
    sql = "call psi.shipGoodsII(#{msid},'20181211')"
    puts "#{sql}"
    res = rds.prepare(sql)
    res.execute
    msid += 1
end
